import request from '@/utils/request';
import store from '@/store'

// 新增
export function addQuote(data) {
  data.forEach(item => {
    item.createUserId = store.getters.userId;
    item.updateUserId = store.getters.userId;
  })
  return request({
    url: '/maintain/maintain/quote/addQuoteList',
    method: 'put',
    data: data
  })
}
// 修改
export function editQuote(data) {
  data.forEach(item => {
    item.createUserId = store.getters.userId;
    item.updateUserId = store.getters.userId;
  })
  return request({
    url: '/maintain/maintain/quote/editQuoteList',
    method: 'put',
    data: data
  })
}
// 列表保存
export function saveQuote(data) {
  const params = {
    ...data,
    updateUserId: store.getters.userId
  }
  return request({
    url: '/maintain/maintain/quote/editQuote',
    method: 'put',
    data: params
  })
}
// 列表删除
export function deleteQuoteGroup(data) {
  return request({
    url: '/maintain/maintain/quote/deleteQuoteGroup',
    method: 'delete',
    data: data
  })
}
// 详情
export function details(data) {
  return request({
    url: '/maintain//maintain/quote/getQuoteByNode/',
    method: 'get',
    params: data
  })
}